$(function(){

  // Bind the event.
  $(window).hashchange( function(){

    // Alerts every time the hash changes!
    if(location.hash == "") {
    	$('#content').load('main.html');
    } else {
      $('.active').removeClass('active');
      var hash = location.hash;
    	
      switch(hash) {
        case "#reports":
          $('#reports').addClass('active');
          $('#content').load('reports.html');
          break;

        case "#contact":
          $('#contact').addClass('active');
          console.log(hash);
          break;
      }
    }
  })

  // Trigger the event (useful on page load).
  $(window).hashchange();

});
